<template>
	<el-main>
		<el-form>
			<div style="text-align: center;font-weight: 600;font-size: 16px">
				【{{form.planTypeName}}】{{ form.title }}
			</div>
			<div style="margin:20px 0px 20px 0px">
				<div style="display: inline-block">开始时间:{{ form.beginTime }}</div>
				<div style="display: inline-block;float: right;">结束时间:{{ form.endTime }}</div>
			</div>
			<div style="margin:20px 0px 20px 0px">
				<div style="display: inline-block">计划负责人:{{ form.holdUserName }}</div>
				<div style="display: inline-block;float: right;">督办领导:{{ form.supUserName }}</div>
			</div>
			<el-form-item label="计划详情">
				<div v-html="form.content"></div>
			</el-form-item>
			<el-form-item label="计划附件" v-if="form.attachId!=''">
				<attach-menu :attachIds="form.attachId" :roleFlag="form.attachRole" :preview="true"></attach-menu>
			</el-form-item>
			<div v-if="processList.length>0">
				<el-divider>处理结果</el-divider>
				<el-form-item label="处理意见" v-for="item in processList" :key="item.processId">
					{{item.remark}}
					<div style="width: 100%;">
						<attach-menu :attachIds="item.attachId" :roleFlag="3" :preview="true"></attach-menu>
					</div>
				</el-form-item>
			</div>
		</el-form>
	</el-main>
</template>

<script>
import AttachMenu from '@/views/module/attachMenu'
export default {
	emits: ['success', 'closed'],
	components: {
		AttachMenu,
	},
	data() {
		return {
			loading: false,
			processList:[],
			form: {
				planId: this.$route.query.planId,
				sortNo:"",
				title:"",
				planTypeName:"",
				beginTime:"",
				endTime:"",
				holdUserName:"",
				supUserName:"",
				content:"",
				attachRole:"",
				attachId:"",
			},
			visible: false,
			isSaveing: false,
		}
	},
	mounted() {
		this.getMyWorkPlanById();
	},
	methods: {
		async getWorkPlanProcessList(){
			var res = await this.$API.office.workPlan.getWorkPlanProcessList.get({planId: this.form.planId});
			if (res.code == 200) {
				this.processList = res.data;
			}
		},
		async getMyWorkPlanById()
		{
			let res = await this.$API.office.workPlan.getMyWorkPlanById.get({planId:this.form.planId});
			{
				if(res.code==200)
				{
					this.form.sortNo = res.data.sortNo
					this.form.title = res.data.title
					this.form.planTypeName = res.data.planTypeName
					this.form.beginTime = res.data.beginTime
					this.form.endTime = res.data.endTime
					this.form.holdUserName = res.data.holdUserName
					this.form.supUserName = res.data.supUserName
					this.form.content = res.data.content
					this.form.attachRole = res.data.attachRole
					this.form.attachId = res.data.attachId
					this.getWorkPlanProcessList();
				}else
				{
					this.$alert(res.message, "提示", {type: 'error'})
				}
			}
		}
	}
}
</script>

<style>
</style>
